<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>{BEESCRM:$title}</title>
    <meta name="description" content="">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui, user-scalable=no">
    <meta http-equiv="cleartype" content="on">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/assets/complaint/css/style.css">
    <link rel="stylesheet" href="/assets/complaint/css/layer.css">
</head>
<body>
<div class="wrapper">
    <div class="header flex">
        <a href="/Complaint/Common/index/irs_id/{BEESCRM:$irs_id}" class="iconfont icon-zuo white"></a>
        <div class="font-16">公寓列表</div>
        <a href="/Complaint/Common/history/irs_id/{BEESCRM:$irs_id}" class="iconfont icon-xinxi font-20 white">
            <div class="origin"></div>
        </a>
    </div>
    <div class="content">
        <div class="padding-10 flex">
            <div>全部公寓</div>
            <!--<span class='green' href="/Complaint/Common/applyRight/irs_id/{BEESCRM:$irs_id}">申请</span>-->
            <span class='green' id="apply" onclick="apply();" >申请</span>
        </div>
        <input type="hidden" value="{BEESCRM:$restaurant_id}" id="restaurant_id">
        <div class="main" id="restaurant">
            <volist name="restaurants" id="vo">
                <div class="main-list flex-2">
                    <div class="left ">
                        <input type="hidden" value="{BEESCRM:$vo.restaurant_img}">
                        <img onerror="this.src='/assets/complaint/images/house.jpg'" src="{BEESCRM:$vo.restaurant_img}"
                             alt="">
                    </div>
                    <div class="right">
                        <div class="text-right">
                            <a href="/Complaint/Common/comment/restaurant_id/{BEESCRM:$vo.restaurant_id}/irs_id/{BEESCRM:$irs_id}"
                               class="column text-center column-one font-12">评价</a>
                        </div>
                        <div class="gray">{BEESCRM:$vo.apartment_name}</div>
                        <div class="text-right">
                            <a href="/Complaint/Common/apartment/restaurant_id/{BEESCRM:$vo.restaurant_id}/irs_id/{BEESCRM:$irs_id}"
                               class="column text-center column-two font-12">投诉</a>
                        </div>
                    </div>
                </div>
            </volist>
        </div>
    </div>
    <div class="blank text-center flex-3">
    </div>
    <!--<div class="bottom-hint text-center flex-3">-->
        <!--<hr>-->
        <!--&lt;!&ndash;<if condition="$count lt 10">&ndash;&gt;-->
            <!--&lt;!&ndash;<a class="margin-4" id="more" value="more" style="display: none">加载更多</a>&ndash;&gt;-->
            <!--&lt;!&ndash;<span class="margin-4 gray2" id="nomore" style="display: block">没有更多了</span>&ndash;&gt;-->
        <!--&lt;!&ndash;<else/>&ndash;&gt;-->
            <!--&lt;!&ndash;<a class="margin-4" id="more" value="more">加载更多</a>&ndash;&gt;-->
            <!--&lt;!&ndash;<span class="margin-4 gray2" id="nomore" style="display: none">没有更多了</span>&ndash;&gt;-->
        <!--&lt;!&ndash;</if>&ndash;&gt;-->
        <!--<span class="margin-4 gray2" id="nomore" style="display: none">没有更多了</span>-->
        <!--<hr>-->
    <!--</div>-->

    <div class="bottom-hint text-center flex-3" ><span class="margin-4 gray2"  id="more"></span></div>
</div>
<include file="Common:load"/>
</body>
<script src="/assets/complaint/js/jquery-2.1.0.min.js"></script>
<script src="/assets/complaint/js/public.js"></script>
<script src="/assets/complaint/js/layer.js"></script>
<script type="text/javascript">

var height = $(window).height();
$('.wrapper').css('minHeight', height);
        //异步加载更多餐厅
    var page =1;
    $(window).scroll(function(event) {
        if ($(document).scrollTop() + $(window).height() > $(document).height() - 100) {
            ajax_get_order();
        }
    });
        function ajax_get_order(){
            page +=1;
            $.ajax({
                data:{page: page,is_ajax:1},
                method: 'post',
                dataType: 'html',
                url: '/Complaint/Common/index/irs_id/{BEESCRM:$irs_id}',//+tab,
                success: function(data)
                {
                    if(data == ''){
                        $('#more').text('没有更多了');
                    }else
                    {
                        $("#restaurant").append(data);
                    }
                }
            });
        }



        function apply(){
            var restaurant_id=$('#restaurant_id').val();
            window.location.href="/Complaint/Common/applyRight/irs_id/{BEESCRM:$irs_id}/ids/"+restaurant_id;
        }

</script>

<!--<script type="text/javascript">-->

    <!--var start = 10;-->

    <!--$('#more').click(function () {-->

        <!--var result = getParams(start);-->

    <!--});-->

    <!--function getParams(id) {-->

        <!--var result = null;-->

        <!--$.ajax({-->
            <!--url: "/Complaint/Common/ajaxAsynRestaurant",-->
            <!--type: "post",-->
            <!--dataType: 'json',-->
            <!--async: false,-->
            <!--data: {-->
                <!--start: id-->
            <!--},-->
            <!--beforeSend: function(){-->
                <!--fm.showLoging('正在努力刷新...');-->
            <!--},-->
            <!--success: function (data) {-->
                <!--fm.closeLayer();-->
                <!--if (data.status == 'S') {-->
                    <!--var result = data.restaurants;-->
                    <!--$.each(result, function (index, node) {-->
                        <!--var div = document.createElement("div");-->
                        <!--div.className = 'main-list flex-2';-->
                        <!--var subdiv1 = document.createElement("div");-->
                        <!--subdiv1.className = 'left';-->
                        <!--var img = document.createElement("img");-->
                        <!--img.onerror = null;-->
                        <!--img.src = node.restaurant_img;-->
                        <!--img.alt = '';-->
                        <!--subdiv1.appendChild(img);-->
                        <!--var subdiv2 = document.createElement("div");-->
                        <!--subdiv2.className = 'right';-->
                        <!--var nextdiv1 = document.createElement("div");-->
                        <!--nextdiv1.className = 'text-right';-->
                        <!--var a1 = document.createElement("a");-->
                        <!--a1.className = 'column text-center column-one font-12';-->
                        <!--a1.href = '/Complaint/Common/comment/restaurant_id/'+node.restaurant_id;-->
                        <!--a1.innerHTML = '评价';-->
                        <!--nextdiv1.appendChild(a1);-->
                        <!--var nextdiv2 = document.createElement("div");-->
                        <!--nextdiv2.className = 'gray';-->
                        <!--nextdiv2.innerHTML = node.restaurant_name;-->
                        <!--var nextdiv3 = document.createElement("div");-->
                        <!--nextdiv3.className = 'text-right';-->
                        <!--var a2 = document.createElement("a");-->
                        <!--a2.className = 'column text-center column-two font-12';-->
                        <!--a2.href = '#';-->
                        <!--a2.innerHTML = '投诉';-->
                        <!--nextdiv3.appendChild(a2);-->
                        <!--subdiv2.appendChild(nextdiv1);-->
                        <!--subdiv2.appendChild(nextdiv2);-->
                        <!--subdiv2.appendChild(nextdiv3);-->
                        <!--div.appendChild(subdiv1);-->
                        <!--div.appendChild(subdiv2);-->
                        <!--$("#restaurant").append(div);-->

                    <!--});-->
                    <!--start = data.start;-->
                    <!--page_num = data.start;-->
                <!--}-->
                <!--if (data.status == 'F') {-->
                    <!--document.getElementById("more").style.display = "none";-->
                    <!--document.getElementById("nomore").style.display = "block";-->
                    <!--return 1;-->
                <!--}-->
            <!--},-->
            <!--error: function (res) {-->
                <!--fm.closeLayer();-->
                <!--fm.alert(res.message,'',3)-->
            <!--}-->

        <!--});-->

        <!--return-->
    <!--}-->
<!--</script>-->

</html>